/*******************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
  * @file     data.c
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-01
  * @brief
 ********************************************************************************/

#include "data.h"

// TFT info
uint32_t gBaudrate = 0;
uint16_t LCD_XSIZE_TFT = 0;
uint16_t LCD_YSIZE_TFT = 0;
uint16_t LCD_VBPD = 0;
uint16_t LCD_VFPD = 0;
uint16_t LCD_VSPW = 0;
uint16_t LCD_HBPD = 0;
uint16_t LCD_HFPD = 0;
uint16_t LCD_HSPW = 0;
uint8_t gPCLKRISING = 0;
uint8_t gHSYNCPolarity = 0;
uint8_t gVSYNCPolarity = 0;
uint8_t gDEPolarity = 0;
// uint8_t  R_ANGLE=0;         //reserved
uint32_t TFT_color = 0;

// pic
uint8_t DMA_rxbuf1[DMA_LEN4];
uint8_t DMA_rxbuf2[DMA_LEN4];
uint8_t DMA_txbuf1[2048];
uint8_t Table_color[512];
uint8_t m_PngData[MAX_PixelSize];
uint16_t *p16_m_PngData = (uint16_t *)m_PngData;
uint16_t *p16_DMA_rxbuf1 = (uint16_t *)DMA_rxbuf1;
uint16_t *p16_DMA_rxbuf2 = (uint16_t *)DMA_rxbuf2;

uint32_t FullScreen_addr, FullScreen_color;
uint8_t FullScreen_flag;

/* ------ popup window ------ */
uint16_t Page_VirW, Page_VirH;
uint32_t Page_VirAddr, Page_VirLen;
uint8_t Page_VirFlag;

/* ------ picture parameter ------ */
zippic_struct zippic;
jpg_TRAN jpgTr;
_PICINFO PICINFO[10];
uint16_t LT_BG_IOCNID = 0xFFFF;  // background select (gif/icon)id
uint16_t LT_BG_GIFID = 0xFFFF;
// UART
USART_RX_INFO gUsartRx;
#if (UARTBUS_OPTION == 5 || UARTBUS_OPTION == 6)
Hid_RX_INFO gHidRx; // Structure used to store received results
#endif

// Backlight
uint16_t gControlDuty = 400;

//tp
uint8_t First_press = 0;
uint16_t First_pressX, First_pressY;

// rtp
TP_xfac gTpxfac;
TP_xoff gTpxoff;
TP_yfac gTpyfac;
TP_yoff gTpyoff;
uint8_t RTP_read_Flag = 0;
uint16_t RTP_time = 0;

// touch
TP_INFO gTpInfo;
